<template>

  <div>
    <div class="list">
      <p>合约列表 <el-button type="primary" @click="getPaiMaiContracts">更新拍卖合约列表</el-button></p>
    </div>
    <el-table
      :data="paiMaiContracts"
      style="width: 100%">
      <el-table-column
        prop="id"
        label="拍卖名称"
        width="100">
      </el-table-column>
      <el-table-column
        prop="contractAddress"
        label="合约地址"
        width="350">
      </el-table-column>
      <el-table-column
        prop="beneficiary"
        label="受益人地址"
        width="350">
      </el-table-column>
      <el-table-column
        prop="biddingTime"
        label="拍卖持续时间(秒)"
        width="100">
      </el-table-column>
      <el-table-column
        prop="endTime"
        label="结束时间"
        width="160">
      </el-table-column>
      <el-table-column
        prop="contractStatus"
        label="状态"
        width="85">
      </el-table-column>
      <el-table-column
        prop="highestBid"
        label="当前最高出价"
        width="110">
      </el-table-column>
      <el-table-column
        prop="highestBidder"
        label="当前最高出价人地址"
        width="350">
      </el-table-column>
      <el-table-column
        fixed="right"
        label="操作"
        width="140">
        <router-link :to="{ path: '/contractInfo' }">查询</router-link> |
<!--        <router-link :to="{ path: '/contractInfo',query:{addr:work_task.id} }">查询</router-link> |-->
        <router-link :to="{ path: '/invokingContract' }">出价</router-link> |
        <router-link :to="{ path: '/paiMaiWithdraw' }">赎回</router-link> |
      </el-table-column>
    </el-table><br><br>
     <div>
      <router-view></router-view>
     </div>
  </div>


</template>

<script>
export default {
  name: "contractList",
  data() {
    return {
      paiMaiContracts: "",
    }
  },
  mounted() {
    this.getPaiMaiContracts()
  },
  methods: {
    //点击更新按钮请求账户列表
    getPaiMaiContracts() {
      this.axios.get("/getPaiMaiContracts").then(res => {
        this.paiMaiContracts = res.data;
      })
    },
    // toContractInfo() {
    //   this.$router.push({name: 'contractInfo'})
    // },
    // toInvokingContract() {
    //   this.$router.push({name: 'invokingContract'})
    // },
    // toPaiMaiWithdraw() {
    //   this.$router.push({name: 'paiMaiWithdraw'})
    // },

    },
}
</script>

<style scoped>
.list{padding:0;
  margin:0;
  text-align: left;
  list-style-type: none;}


</style>
